//
//  CoreAnimationController.m
//  test
//
//  Created by 科迈捷 on 2017/3/28.
//  Copyright © 2017年 科迈捷. All rights reserved.
//

#import "CoreAnimationController.h"
#import "TouchExampleController.h"

@interface CoreAnimationController () {
    NSArray *_titles;
}

@end

@implementation CoreAnimationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    /*
        设置UI
     */
    self.tableView.tableFooterView = [UIView new];
    self.view.layer.contents = (id)[UIImage imageNamed:@"3"].CGImage;
    self.view.layer.contentsGravity = @"resizeAspectFill";
    self.view.layer.masksToBounds = YES;
    
    _titles = @[@"CAKeyframeAnimation",@"UIView自定义过渡动画效果",@"自定义转场动画1"];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *identifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    cell.textLabel.text = _titles[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    TouchExampleController *vc = [TouchExampleController new];
    vc.type = indexPath.row;
    [self.navigationController pushViewController:vc animated:YES];
}
@end
